<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "sys_item_size".
 *
 * @property integer $id
 * @property integer $item_id
 * @property string $size
 * @property string $volume
 */
class SysItemSize extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'sys_item_size';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['item_id'], 'required'],
            [['item_id'], 'integer'],
            [['size'], 'string', 'max' => 50],
            [['volume'], 'string', 'max' => 200],
            [['item_id', 'size'], 'unique', 'targetAttribute' => ['item_id', 'size'], 'message' => 'The combination of Item ID and Size has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'item_id' => 'Item ID',
            'size' => Yii::t('app','Size'),
            'volume' =>  Yii::t('app','Volume'),
        ];
    }
}
